import { getColsByColTypes } from './CustomColumnType'
export const profitabilityColTypes = [
  {
    name: 'Date',
    sqlName: 'summaryDate',
    type: 'string',
    default: true,
    sort: '',
    width: '180'
  },
  {
    name: 'Seller',
    sqlName: 'sellerName',
    type: 'string',
    default: true,
    sort: '',
    width: '150'
  },
  {
    name: 'Market',
    sqlName: 'countryCode',
    type: 'string',
    default: true,
    sort: '',
    width: '100'
  },
  {
    name: 'Product',
    sqlName: '',
    type: 'product',
    default: true,
    sort: '',
    width: '350'
  },
  // {
  //   name: 'Asin',
  //   sqlName: 'asin',
  //   type: 'string',
  //   default: true,
  //   sort: '',
  //   width: '140'
  // },
  {
    name: 'Parent Asin',
    sqlName: 'parentAsin',
    type: 'string',
    default: true,
    sort: '',
    width: '140'
  },
  {
    name: 'MSKU',
    sqlName: 'sku',
    type: 'string',
    default: true,
    sort: '',
    width: '140'
  },
  {
    name: 'FBA Sales',
    sqlName: 'revenueFbaSales',
    type: 'money',
    default: true,
    sort: 'Sales',
    groupName: 'Amazon Sales'
  },
  {
    name: 'FBA\nSales Units',
    sqlName: 'revenueFbaSaleUnits',
    type: 'number',
    default: true,
    sort: 'Sales',
    groupName: 'Amazon Sales'
  },
  {
    name: 'FBM Sales',
    sqlName: 'revenueFbmSales',
    type: 'money',
    default: true,
    sort: 'Sales',
    groupName: 'Amazon Sales'
  },
  {
    name: 'FBM\nSales Units',
    sqlName: 'revenueFbmSaleUnits',
    type: 'number',
    default: true,
    sort: 'Sales',
    groupName: 'Amazon Sales'
  },
  // {
  //   name: 'Multichannel\nSales',
  //   sqlName: 'revenueMultichannelSales',
  //   type: 'money',
  //   default: true,
  //   sort: 'Sales',
  //   groupName: 'Multichannel Sales'
  // },
  {
    name: 'Multichannel\nSales Units',
    sqlName: 'revenueMultichannelSaleUnits',
    type: 'number',
    default: true,
    sort: 'Sales',
    groupName: 'Multichannel Sales'
  },
  {
    name: 'Principal Tax',
    sqlName: 'revenuePrincipalTax',
    type: 'money',
    groupName: 'Tax',
    sort: 'Tax',
    ignore: true
  },
  {
    name: 'Shipping Tax',
    sqlName: 'revenueShippingTax',
    type: 'money',
    groupName: 'Tax',
    sort: 'Tax',
    ignore: true
  },
  {
    name: 'Gift Wrap Tax',
    sqlName: 'revenueGiftWrapTax',
    type: 'money',
    groupName: 'Tax',
    sort: 'Tax',
    ignore: true
  },
  {
    name: 'Total Tax Income',
    sqlName: 'revenueTotalTax',
    type: 'money',
    groupName: 'Tax',
    ignore: true,
    width: '140'
  },
  {
    name: 'Total Sales',
    sqlName: 'revenueTotalSales',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Total Sales'
  },
  {
    name: 'Total\nSales Units',
    sqlName: 'revenueTotalSalesUnits',
    type: 'number',
    default: true,
    sort: '',
    groupName: 'Total Sales'
  },
  {
    name: 'FBA Shipping',
    sqlName: 'revenueFbaShipping',
    type: 'money',
    default: true,
    sort: 'Shipping',
    groupName: 'FBA Shipping'
  },
  {
    name: 'FBM Shipping',
    sqlName: 'revenueFbmShipping',
    type: 'money',
    default: true,
    sort: 'Shipping',
    groupName: 'FBM Shipping'
  },
  {
    name: 'Total Shipping',
    sqlName: 'revenueTotalShippingSales',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Total Shipping'
  },
  {
    name: 'Gift Wrap',
    sqlName: 'revenueGiftWrapSales',
    type: 'money',
    default: true,
    sort: 'Gift Wrap Income',
    groupName: 'Gift Wrap'
  },
  {
    name: 'Reimbursement',
    sqlName: 'revenueReimbursementFee',
    type: 'money',
    default: true,
    sort: 'Reimbursement',
    width: '140',
    groupName: 'Reimbursement'
  },
  {
    name: 'SafeT\nReimbursementItem',
    sqlName: 'revenueSafetReimbursement',
    type: 'money',
    default: false,
    sort: 'Reimbursement',
    width: '170',
    groupName: 'Reimbursement'
  },
  {
    name: 'FBA\nLiquidation',
    sqlName: 'revenueFbaRemoveOrLiquidation',
    type: 'money',
    default: false,
    sort: 'Other Income',
    groupName: 'Other Income'
  },
  {
    name: 'Commission\nRefund',
    sqlName: 'revenueCommissionRefund',
    type: 'money',
    default: false,
    sort: 'Other Income',
    groupName: 'Other Income'
  },
  {
    name: 'COD Charge',
    sqlName: 'revenueCodChargeback',
    type: 'money',
    default: false,
    sort: 'Other Income',
    groupName: 'Other Income'
  },
  {
    name: 'Restocking Fee',
    sqlName: 'revenueRestockingRefund',
    type: 'money',
    default: false,
    sort: 'Other Income',
    groupName: 'Other Income',
    width: '140'
  },
  {
    name: 'Adjustment\nIncome',
    sqlName: 'revenueAdjustment',
    type: 'money',
    default: false,
    sort: 'Other Income',
    groupName: 'Other Income'
  },
  {
    name: 'Total Income',
    sqlName: 'totalRevenue',
    type: 'money',
    default: true,
    sort: ''
  },
  {
    name: 'Principal\nTax Withhold',
    sqlName: 'expensePrincipalTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax Withhold',
    ignore: true
  },
  {
    name: 'Shipping\nTax Withhold',
    sqlName: 'expenseShippingTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax Withhold',
    ignore: true
  },
  {
    name: 'Gift Wrap\nTax Withhold',
    sqlName: 'expenseGiftWrapTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax Withhold',
    ignore: true
  },
  {
    name: 'Total Tax\nWithhold',
    sqlName: 'expenseTotalTaxWithheld',
    type: 'money',
    groupName: 'Tax Withhold',
    default: true,
    ignore: true
  },
  {
    name: 'Principal Tax',
    sqlName: 'revenuePrincipalTax',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax'
  },
  {
    name: 'Shipping Tax',
    sqlName: 'revenueShippingTax',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax'
  },
  {
    name: 'Gift Wrap Tax',
    sqlName: 'revenueGiftWrapTax',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax'
  },
  {
    name: 'Total Tax Income',
    sqlName: 'revenueTotalTax',
    type: 'money',
    groupName: 'Tax',
    default: true
  },
  {
    name: 'Principal\nTax Withhold',
    sqlName: 'expensePrincipalTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax'
  },
  {
    name: 'Shipping\nTax Withhold',
    sqlName: 'expenseShippingTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax'
  },
  {
    name: 'Gift Wrap\nTax Withhold',
    sqlName: 'expenseGiftWrapTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Tax',
    groupName: 'Tax'
  },
  {
    name: 'Total Tax\nWithhold',
    sqlName: 'expenseTotalTaxWithheld',
    type: 'money',
    groupName: 'Tax',
    default: true
  },
  {
    name: 'Promotion\nDiscount',
    sqlName: 'expensePromotionDiscount',
    type: 'money',
    default: true,
    sort: 'Merchandising',
    groupName: 'Merchandising',
    width: '140'
  },
  {
    name: 'Vine\nEnrollment Fee',
    sqlName: 'expenseVineEnrollmentFee',
    type: 'money',
    default: true,
    sort: 'Merchandising',
    groupName: 'Merchandising',
    width: '140'
  },
  {
    name: 'Deal Fee',
    sqlName: 'expenseDealFee',
    type: 'money',
    default: true,
    sort: 'Merchandising',
    groupName: 'Merchandising',
    width: '140'
  },
  {
    name: 'Coupon\nClip&Redemption Fee',
    sqlName: 'expenseCouponClipAndRedemptionFee',
    type: 'money',
    default: true,
    sort: 'Merchandising',
    groupName: 'Merchandising',
    width: '180'
  },
  {
    name: 'Gift Wrap\nCommission',
    sqlName: 'expenseGiftWrapCommission',
    type: 'money',
    default: true,
    sort: 'Gift Wrap Expense',
    groupName: 'Gift Wrap Expense'
  },
  {
    name: 'Gift Wrap\nChargeback',
    sqlName: 'expenseGiftWrapChargeback',
    type: 'money',
    default: true,
    sort: 'Gift Wrap Expense',
    groupName: 'Gift Wrap Expense'
  },
  {
    name: 'Commission',
    sqlName: 'expenseCommission',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Amazon Fees'
  },
  {
    name: 'Monthly\nSubscription Fee',
    sqlName: 'expenseMonthlySubscriptionFee',
    type: 'money',
    default: true,
    sort: 'Amazon Fees',
    groupName: 'Amazon Fees',
    width: '140'
  },
  {
    name: 'Sales Tax\nCollection Fee',
    sqlName: 'expenseSalesTaxCollectionFee',
    type: 'money',
    default: false,
    sort: 'Amazon Fees',
    groupName: 'Amazon Fees',
    width: '140'
  },
  {
    name: 'Amazon\nAccelerator Fee',
    sqlName: 'expenseAmazonAcceleratorFee',
    type: 'money',
    default: false,
    sort: 'Amazon Fees',
    groupName: 'Amazon Fees',
    width: '140'
  },
  {
    name: 'Amazon\nExclusives Fee',
    sqlName: 'expenseAmazonExclusivesFee',
    type: 'money',
    default: false,
    sort: 'Amazon Fees',
    groupName: 'Amazon Fees',
    width: '140'
  },
  {
    name: 'Total\nAmazon Fees',
    sqlName: 'expenseTotalAmazonFees',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Amazon Fees'
  },
  {
    name: 'Closing Fees',
    sqlName: 'expenseClosingFee',
    type: 'money',
    default: false,
    sort: 'Amazon Other Fees',
    groupName: 'Amazon Other Fees'
  },
  {
    name: 'COD\nChargeBack',
    sqlName: 'expenseCodChargeback',
    type: 'money',
    default: false,
    sort: 'Amazon Other Fees',
    groupName: 'Amazon Other Fees'
  },
  {
    name: 'Total Amazon\nOther Fees',
    sqlName: 'expenseTotalAmazonOtherFees',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Amazon Other Fees'
  },
  {
    name: 'FBA Fulfillment Fees\n/Easy Ship Fee',
    sqlName: 'expenseFulfillmentFee',
    type: 'money',
    default: true,
    sort: 'FBA Fulfillment Fees',
    groupName: 'FBA Fulfillment Fees',
    width: '160'
  },
  {
    name: 'Shipping\nChargeback',
    sqlName: 'expenseShippingChargeback',
    type: 'money',
    default: true,
    sort: 'FBA Fulfillment Fees',
    groupName: 'FBA Fulfillment Fees'
  },
  {
    name: 'Shipping\nHB Fee',
    sqlName: 'expenseShippingHb',
    type: 'money',
    default: false,
    sort: 'FBA Fulfillment Fees',
    groupName: 'FBA Fulfillment Fees'
  },
  {
    name: 'Total FBA\nFulfillment Fees',
    sqlName: 'expenseTotalFbaFulfillmentFees',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'FBA Fulfillment Fees',
    width: '140'
  },
  {
    name: 'FBA Inventory Remove\n/Liquidation Fee',
    sqlName: 'expenseFbaRemoveOrLiquidation',
    type: 'money',
    default: false,
    sort: 'FBA Other Fees',
    groupName: 'FBA Other Fees',
    width: '180'
  },
  {
    name: 'FBA Prep\nService Fees',
    sqlName: 'expenseFbaPrepServiceFees',
    type: 'money',
    default: false,
    sort: 'FBA Other Fees',
    groupName: 'FBA Other Fees',
    width: '140'
  },
  {
    name: 'FBA\nTransportation Fee',
    sqlName: 'expenseFbaTransportationFee',
    type: 'money',
    default: false,
    sort: 'FBA Other Fees',
    groupName: 'FBA Other Fees',
    width: '150'
  },
  {
    name: 'FBA Inventory\nPlacement Service Fees',
    sqlName: 'expenseFbaInventoryPlacementServiceFee',
    type: 'money',
    default: false,
    sort: 'FBA Other Fees',
    groupName: 'FBA Other Fees',
    width: '180'
  },
  {
    name: 'Total FBA\nOther Fees',
    sqlName: 'expenseTotalFbaOtherFees',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'FBA Other Fees'
  },
  {
    name: 'FBA Inventory\nMonthly Storage Fee',
    sqlName: 'expenseFbaMonthlyStorageFee',
    type: 'money',
    default: true,
    sort: 'FBA Storage Fees',
    groupName: 'FBA Storage Fees',
    width: '160'
  },
  {
    name: 'FBA Long-Term\nStorage Fees',
    sqlName: 'expenseFbaLongTermStorageFee',
    type: 'money',
    default: true,
    sort: 'FBA Storage Fees',
    groupName: 'FBA Storage Fees',
    width: '140'
  },
  {
    name: 'Total FBA\nStorage Fees',
    sqlName: 'expenseTotalFbaStorageFees',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'FBA Storage Fees'
  },
  {
    name: 'Refund\nAdministration Fee',
    sqlName: 'expenseRefundAdministrationFee',
    type: 'money',
    default: true,
    sort: 'Product Refund',
    groupName: 'Product Refund',
    width: '160'
  },
  {
    name: 'Return Units',
    sqlName: 'expenseRefundUnits',
    type: 'number',
    default: true,
    sort: '',
    groupName: 'Product Refund'
  },
  {
    name: 'Principal Refund',
    sqlName: 'expenseRefundPrincipal',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Product Refund',
    width: '140'
  },
  {
    name: 'Gift Wrap Refund',
    sqlName: 'expenseRefundGiftWrap',
    type: 'money',
    default: true,
    sort: 'Product Refund',
    groupName: 'Product Refund',
    width: '140'
  },
  {
    name: 'Shipping Refund',
    sqlName: 'expenseRefundShipping',
    type: 'money',
    default: true,
    sort: 'Product Refund',
    groupName: 'Product Refund',
    width: '140'
  },
  {
    name: 'Return Shipping',
    sqlName: 'expenseReturnShipping',
    type: 'money',
    default: true,
    sort: 'Product Refund',
    groupName: 'Product Refund',
    width: '140'
  },
  {
    name: 'Total Refund',
    sqlName: 'expenseTotalRefund',
    type: 'money',
    default: true,
    sort: '',
    groupName: 'Product Refund'
  },
  {
    name: 'Adjustment\nExpense',
    sqlName: 'expenseAdjustment',
    type: 'money',
    default: true,
    sort: 'Adjustment Expense',
    groupName: 'Adjustment Expense'
  },
  {
    name: 'SB',
    sqlName: 'expenseAdSbCost',
    type: 'money',
    default: true,
    sort: 'Advertising',
    groupName: 'Advertising'
  },
  {
    name: 'SD',
    sqlName: 'expenseAdSdCost',
    type: 'money',
    default: true,
    sort: 'Advertising',
    groupName: 'Advertising'
  },
  {
    name: 'SP',
    sqlName: 'expenseAdSpCost',
    type: 'money',
    default: true,
    sort: 'Advertising',
    groupName: 'Advertising'
  },
  {
    name: 'Total Expense',
    sqlName: 'totalExpense',
    type: 'money',
    default: true,
    sort: '',
    groupName: ''
  },
  {
    name: 'Gross Profit',
    sqlName: 'grossProfitability',
    type: 'money',
    default: true,
    sort: '',
    fixed: 'right',
    groupName: 'Profitability'
  },
  {
    name: 'Gross Profit\nMargin',
    sqlName: 'grossProfitabilityMargin',
    type: 'percent',
    default: true,
    sort: '',
    fixed: 'right',
    groupName: 'Profitability'
  },
  {
    name: 'ROI',
    sqlName: 'roi',
    type: 'percent',
    default: true,
    sort: '',
    fixed: 'right',
    groupName: 'Profitability'
  }
]
export const profitabilityCol = getColsByColTypes(profitabilityColTypes.filter(v => !v.ignore))
export const colorList = [
  '#5D9CFC',
  '#5BC2FE',
  '#39DAE2',
  '#4AD2A2',
  '#8DD96F',
  '#FFB03E',
  '#FF975D',
  '#FF7B7B',
  '#FC7DCA',
  '#3E65EF',
  '#8081FC',
  '#B37EE6',
  '#B197DA'
]
export const profitabilityGroupColorList = [
  'Amazon Sales',
  'Multichannel Sales',
  'Tax',
  'Total Sales',
  'FBA Shipping',
  'FBM Shipping',
  'Total Shipping',
  'Gift Wrap',
  'Reimbursement',
  'Tax Withhold',
  'Other Income',
  'Merchandising',
  'Gift Wrap Expense',
  'Amazon Fees',
  'Amazon Other Fees',
  'FBA Fulfillment Fees',
  'FBA Other Fees',
  'FBA Storage Fees',
  'Product Refund',
  'Adjustment Expense',
  'Advertising',
  'Profitability'
].map((v, i) => {
  return {
    name: v,
    color: colorList[i % colorList.length]
  }
})
export const profitabilityLiteColTypes = [
  {
    name: 'Date',
    sqlName: 'summaryDate',
    type: 'string',
    default: true,
    sort: '',
    width: '180'
  },
  {
    name: 'Seller',
    sqlName: 'sellerName',
    type: 'string',
    default: true,
    sort: '',
    width: '150'
  },
  {
    name: 'Product',
    sqlName: '',
    type: 'product',
    default: true,
    sort: '',
    width: '350'
  },
  {
    name: 'Orders',
    sqlName: 'revenueTotalOrders',
    type: 'number',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Sale Units',
    sqlName: 'revenueTotalSalesUnits',
    type: 'number',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Sales',
    sqlName: 'revenueTotalSales',
    type: 'money',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Tax',
    sqlName: 'revenueTotalTax',
    type: 'money',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Shipping',
    sqlName: 'revenueTotalShippingSales',
    type: 'money',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Reimbursement',
    sqlName: 'revenueTotalReimbursementFees',
    type: 'money',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Other Income',
    sqlName: 'revenueTotalOther',
    type: 'money',
    default: true,
    sort: 'Revenue',
    groupName: 'Revenue'
  },
  {
    name: 'Merchandising',
    sqlName: 'expenseTotalMerchandising',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'Tax Withhold',
    sqlName: 'expenseTotalTaxWithheld',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'Commission',
    sqlName: 'expenseCommission',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'FBA Fulfillment\nFees',
    sqlName: 'expenseTotalFbaFulfillmentFees',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'FBA Storage\nFees',
    sqlName: 'expenseTotalFbaStorageFees',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'Advertising',
    sqlName: 'expenseTotalAdvertising',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'Amazon Other\nFees',
    sqlName: 'expenseTotalAmazonOtherFees',
    type: 'money',
    default: true,
    sort: 'Cost',
    groupName: 'Cost'
  },
  {
    name: 'Gross Profit',
    sqlName: 'grossProfitability',
    type: 'money',
    default: true,
    sort: '',
    fixed: 'right',
    groupName: 'Profitability'
  },
  {
    name: 'Gross Profit\nMargin',
    sqlName: 'grossProfitabilityMargin',
    type: 'percent',
    default: true,
    sort: '',
    fixed: 'right',
    groupName: 'Profitability'
  },
  {
    name: 'ROI',
    sqlName: 'roi',
    type: 'percent',
    default: true,
    sort: '',
    fixed: 'right',
    groupName: 'Profitability'
  }
]
export const profitabilityLiteCol = getColsByColTypes(profitabilityLiteColTypes.filter(v => !v.ignore))
export const profitabilityLiteGroupColorList = [
  'Revenue',
  'Cost',
  'Profitability'
].map((v, i) => {
  return {
    name: v,
    color: colorList[i % colorList.length]
  }
})
